﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace ProgNetComponents.Design.Attributes
{
    /// <summary>
    /// Returns EditorAttribute
    /// </summary>
    public class UIEditorAttribute : Attribute, IDynamicAttribute
    {
        private Type editorType;
        /// <summary>
        /// Creates UIEditorAttribute instance
        /// </summary>
        /// <param name="editorType"></param>
        public UIEditorAttribute(Type editorType)
        {
            this.editorType = editorType;
        }
        #region IDynamicAttribute Members
        /// <summary>
        /// Returns EditorAttribute(editorType, typeof(System.Drawing.Design.UITypeEditor)
        /// </summary>
        /// <param name="owner"></param>
        /// <returns></returns>
        public Attribute GetRealAttribute(object owner)
        {
            return new EditorAttribute(editorType, typeof(System.Drawing.Design.UITypeEditor));
        }

        #endregion
    }
}
